import React from 'react';
import ReactDom from 'react-dom';

import Li from './Li';
class List extends React.Component{
    constructor(props){
        super(props);
    }
    render(){

        const articleData = this.props.articles;
        const lis = articleData.map(article => <Li title={article.title} content={article.content} />);
        return <ul>
            {lis}
        </ul>;
    }
}

const articles = [
    {title:'tt1',content:'cc1'},
    {title:'tt2',content:'cc2'},
    {title:'tt3',content:'cc3'}
];

ReactDom.render(<List articles={articles} />,document.body);
